main: Push the current event on the stack before we start needing it
authorRui Matos <tiagomatos@gmail.com>
Fri, 5 Jun 2015 17:21:40 +0000 (19:21 +0200)
committerRui Matos <tiagomatos@gmail.com>
Mon, 8 Jun 2015 12:23:19 +0000 (14:23 +0200)
commitef93257db767a52ebd31e89e8560bddf512220cc
treef8820b38b6d1fedbd2268aa1805aef4232567383
parent3c1a2c8d24cce22ebfa67a8ec4548c09e4e700d2
main: Push the current event on the stack before we start needing it

The changes in commit 13e22e20300b7312e52bba7d077fc7e231695fc1 made
_gtk_window_check_handle_wm_event() indirectly depend on
gtk_get_current_event_time() which relies on the current event being
available on the current_events stack.

Since the current event is only pushed on the stack afterwards we get
an invalid timestamp which breaks ewmh window moving.

This fixes the issue by pushing the current event before we start
relying on it being there in gtk_main_do_event() and, as a byproduct,
also fixes a potential memory leak when we have a rewritten event and
return early due to _gtk_window_check_handle_wm_event() being TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=750384
gtk/gtkmain.c